package com.gxa.medical.common;

import lombok.Data;

import java.io.Serializable;

@Data
public class R implements Serializable {
    private Integer code;
    private String msg;
    private Object data;

   //声明一个
    public static R success(){
        R r=new R();
        r.setCode(200);
        r.setMsg("请求成功!");
        return success(null);
    }
    public static R success(Object data){
        R r=new R();
        r.setCode(200);
        r.setMsg("请求成功!");
        r.setData(data);
        return r;
    }

    public static R failed(String s){
        R r=new R();
        r.setCode(0);
        r.setMsg(s);
        return r;
    }

    public static R failed(Integer code,String msg){
        R r=new R();
        r.setCode(code);
        r.setMsg(msg);
        return r;
    }
}
